<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
		<title>对话框</title>
		<link rel="stylesheet" href="css/weui.css" />
		<link rel="stylesheet" href="css/example.css" />
	</head>

	<body>
		<div class="page">
			<div class="hd">
				<h1 class="page_title">Dialog</h1>
			</div>
			<div class="bd spacing">
				<a href="javascript:;" class="weui_btn weui_btn_primary" id="showDialog1">点击弹出Dialog样式一</a>
				<a href="javascript:;" class="weui_btn weui_btn_primary" id="showDialog2">点击弹出Dialog样式二</a>
			</div>
			<!--BEGIN dialog1-->
			<div class="weui_dialog_confirm" id="dialog1" style="display: none;">
				<div class="weui_mask"></div>
				<div class="weui_dialog">
					<div class="weui_dialog_hd"><strong class="weui_dialog_title">弹窗标题</strong></div>
					<div class="weui_dialog_bd">自定义弹窗内容，居左对齐显示，告知需要确认的信息等</div>
					<div class="weui_dialog_ft">
						<a href="javascript:;" class="weui_btn_dialog default">取消</a>
						<a href="javascript:;" class="weui_btn_dialog primary">确定</a>
					</div>
				</div>
			</div>
			<!--END dialog1-->
			<!--BEGIN dialog2-->
			<div class="weui_dialog_alert" id="dialog2" style="display: none;">
				<div class="weui_mask"></div>
				<div class="weui_dialog">
					<div class="weui_dialog_hd"><strong class="weui_dialog_title">弹窗标题</strong></div>
					<div class="weui_dialog_bd">弹窗内容，告知当前页面信息等</div>
					<div class="weui_dialog_ft">
						<a href="javascript:;" class="weui_btn_dialog primary">确定</a>
					</div>
				</div>
			</div>
			<!--END dialog2-->
		</div>
	</body>
	<script src="js/jquery.js"></script>
	<script type="text/javascript">
		$(function() {
			//style1
			$('#showDialog1').on('click', function(e) {
				var $dialog = $('#dialog1');
				$dialog.show();
				$dialog.find('.weui_btn_dialog').on('click', function() {
					$dialog.hide();
				});
			})
			//style2
			$('#showDialog2').on('click', function(e) {
				var $dialog = $('#dialog2');
				$dialog.show();
				$dialog.find('.weui_btn_dialog').on('click', function() {
					$dialog.hide();
				});
			})
		})
	</script>

</html>